package com.rz.htk.template.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.template.entity.Template;
import com.rz.htk.template.entity.TemplateField;
import com.rz.htk.template.entity.vo.TemplateDeleteParam;
import com.rz.htk.template.service.ITemplateFieldService;
import com.rz.htk.template.service.ITemplateService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName TemplateFieldController
 * @Description 模板controller
 * @Author maweiyue
 * @Date 2019/4/17 20:37
 */
@RestController
@RequestMapping("/templateField")
public class TemplateFieldController {

    @Resource
    private ITemplateFieldService templateFieldService;

    @PostMapping("/getPage")
    public ResultResp getPage(@RequestBody TemplateField templateField){
        return RespKit.success(templateFieldService.getPage(templateField));
    }

    @PostMapping("/saveTemplateField")
    public ResultResp saveTemplateField(@RequestBody TemplateField templateField){
        return RespKit.success(templateFieldService.saveTemplateField(templateField));
    }

    @PostMapping("/batchDelete")
    public ResultResp batchDelete(@RequestBody TemplateDeleteParam prdDeleteParam){
        return RespKit.success(templateFieldService.batchDelete(prdDeleteParam));
    }

}
